<%@page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="img/logo.png"/>
    <title>ASSET ADMIN</title>
    <link href="css/bootstrap.css" rel="stylesheet">
    <link rel="stylesheet" href="css/mmss.css"/>
    <link rel="stylesheet" href="css/font-awesome.min.css"/>
    <style>

    </style>
    <script>
    var xmlhttp;
	if (window.XMLHttpRequest)
	{
		//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		// IE6, IE5 浏览器执行代码
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	function inUntreated()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=inUntreated",true);
    	xmlhttp.send();
    }
	
	function done()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=done",true);
    	xmlhttp.send();
    }
	function outUntreated()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=outUntreated",true);
    	xmlhttp.send();
    }
    function outDoneChange()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=outDoneChange",true);
    	xmlhttp.send();
    }
    function queryAllusers()
    {
    	
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp",true);
    	xmlhttp.send();
    }
    function modifyPwd()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","modifyPwd.jsp",true);
    	xmlhttp.send();
    }
    function addUser()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","addUser.jsp",true);
    	xmlhttp.send();
    }
    function inLoading()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=inLoading",true);
    	xmlhttp.send();
    }
    function inNO()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=inNO",true);
    	xmlhttp.send();
    }
    function addChange()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","add.jsp?good=change",true);
    	xmlhttp.send();
    }
    function queryAssetAccount()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=queryAssetAccount",true);
    	xmlhttp.send();
    }
    function addRepair()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","add.jsp?good=repair",true);
    	xmlhttp.send();
    }
    function queryRepair()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=queryRepair",true);
    	xmlhttp.send();
    }
    function changeOK()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=changeOK",true);
    	xmlhttp.send();
    }
    function queryMyAll()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=queryMyAll",true);
    	xmlhttp.send();
    }
    function changeLoading()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","temp.jsp?work=changeLoading",true);
    	xmlhttp.send();
    }
    function js_method()
    {
    	xmlhttp.onreadystatechange=function()
    	{
    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
    			document.getElementById("workspace").innerHTML=xmlhttp.responseText;
    		}
    	}
    	xmlhttp.open("GET","add.jsp",true);
    	xmlhttp.send();
    }
    $(function () { $('.tooltip-show').tooltip();});
    $(function () { $('.tooltip-show-no').tooltip();});
	</script>
</head>
<body>
<header>
    <div class="container-fluid navbar-fixed-top bg-primary">
        <ul class="nav navbar-nav  left">
            <li class="text-white h4">
                &nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-leaf"></span>&nbsp;&nbsp;<b>Ace-Admin</b>
            </li>
        </ul>
        <ul class="nav navbar-nav nav-pills right ">
            <li class="bg-warning ">
                <a href="#"><span class="glyphicon glyphicon-tasks"></span><span class="badge">0</span></a>
            </li>
            <li class="bg-success">
                <a href="http://mail.cuit.edu.cn/"><span class="glyphicon glyphicon-envelope"></span><span class="badge">0</span></a>
            </li>
            <li class="bg-danger">
                <a href="#"><span class="glyphicon glyphicon-bell"></span></a>
            </li>
            <li class="bg-info dropdown">
                <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                    <span class="glyphicon glyphicon-user"></span>&nbsp;<span>${sessionScope.user.userName }</span><span class="caret"></span>
                </a>
                <ul class="dropdown-menu dropdown-menu-right">
                    <li class="text-center"><a href="javascript:void(0);" onclick="modifyPwd()"><span class="text-primary">账号设置</span></a></li>
                    <li class="text-center"><a href="#"><span class="text-primary">消息设置</span></a></li>
                    <li class="text-center"><a href="#"><span class="text-primary">帮助中心</span></a></li>
                    <li class="divider"><a href="#"></a></li>
                    <li class="text-center"><a href="user.con?work=logout"><span class="text-primary">退出/切换账户</span></a></li>
                </ul>
            </li>
        </ul>
    </div>
</header>

<section>
    <div class="container-fluid">
        <div class="row ">
            <!--左侧导航开始-->
            <c:choose>
            	<c:when test="${sessionScope.user.category == 'admin' }">
            		<%@include file="adminNav.jsp" %>
            	</c:when>
            	<c:when test="${sessionScope.user.category == 'worker' }">
            		<%@include file="workerNav.jsp" %>
            	</c:when>
            	<c:when test="${sessionScope.user.category == 'leader' }">
            		<%@include file="leaderNav.jsp" %>
            	</c:when>
            	<c:otherwise>
            		<c:import url="404.jsp"></c:import>
            	</c:otherwise>
            </c:choose>
            	
            <!--左侧导航结束-->
            <!----------------------------------------------------------------------------------------------------->
            <!--右侧内容开始-->
            
            <c:if test="${param.a != '1'  }">
            <div id="workspace" class="col-xs-10">
                <br/>
                <ol class="breadcrumb">
                    <li class="active"><span class="glyphicon glyphicon-home"></span>&nbsp;后台首页</li>
                </ol>
                <h1 class="text-center text-white">Hello!${sessionScope.user.userName } </h1>
                <!----------------------------------------------------------    ------------------------------------------->
            </div>
            </c:if>
            <c:if test="${param.a == '1'  }">
				<%@include file="state.jsp" %>            
            </c:if>
            <!--右侧内容结束-->
        </div>
    </div>
</section>

<footer class="bg-primary navbar-fixed-bottom">
    <p class="text-center text-white">copyright&nbsp;&copy;&nbsp;CUIT</p>
</footer>

<script src="js/jquery-1.11.3.js"></script>
<script src="js/bootstrap.js"></script>
<script>
    /*Bootlint工具用于对页面中的HTML标签以及Bootstrapclass的使用进行检测*/
    
</script>
</body>
</html>